<template>
	<view class="container">
		<top-back-navbar position="fixed" title="个人中心" background="" color="#ffff"></top-back-navbar>
		<view class="content">
			<view class="content_box">
				<view class="u-f-ac input_item" @click="jump" data-src="../../member/info/info">
					<view class="titles">会员资料</view>
					<u-icon name="arrow-right" size="28" color="#cdcfd3"></u-icon>
				</view>
				<!-- 	<view class="u-f-ac input_item" @click="jump" data-src="/pages/member/verified/verified">
		  <view class="titles">实名认证</view>
		  <u-icon name="arrow-right" size="28"></u-icon>
		</view> -->
				<view class="u-f-ac input_item" @click="jump" data-src="/pages/member/zfbPay/qianyuesx">
					<view class="titles">银行绑卡</view>
					<u-icon name="arrow-right" size="28" color="#cdcfd3"></u-icon>
				</view>
				<view class="u-f-ac input_item" @click="jump" data-src="/pages/order/order?index=0">
					<view class="titles">订单提货</view>
					<u-icon name="arrow-right" size="28" color="#cdcfd3"></u-icon>
				</view>
				<view class="u-f-ac input_item" @click="jump" data-src="/pagesZA/media/media">
					<view class="titles">我的社区</view>
					<u-icon name="arrow-right" size="28" color="#cdcfd3"></u-icon>
				</view>
				<view class="u-f-ac input_item" @click="jump" data-src="../../member/address/address">
					<view class="titles">地址管理</view>
					<u-icon name="arrow-right" size="28" color="#cdcfd3"></u-icon>
				</view>

				<view class="u-f-ac input_item" @click="jump" data-src="./invite_code">
					<view class="titles">邀请函</view>
					<u-icon name="arrow-right" size="28" color="#cdcfd3"></u-icon>
				</view>
				<view class="u-f-ac input_item" @click="not" data-src="./xieyi">
					<view class="titles">协议</view>
					<u-icon name="arrow-right" size="28" color="#cdcfd3"></u-icon>
				</view>
				<view class="u-f-ac input_item"  >
					<view class="titles">更新 &nbsp;&nbsp;&nbsp;V{{versionUrl}}</view>
					
					<u-icon name="arrow-right" size="28" color="#cdcfd3"></u-icon>
				</view>
				<view style="padding: 80rpx 120rpx;">
					<button type="primary" style="background-color: #6A41EA; width:100%;border-radius: 60rpx;"
						@click="logout" :loading="loading">退&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;出</button>
				</view>
			</view>

		</view>

		<cxsytabbars :current="3"></cxsytabbars>

	</view>
</template>

<script>
	export default {
		data() {
			return {
				openid: '',
				loading: false,
				versionUrl:''
			}
		},
		onLoad: function() {
			uni.showLoading()
			uni.getStorage({
				key: 'openid',
				success: (res) => {
					this.openid = res.data
					this.get_V()
				},
				fail: () => {}
			});
			uni.hideLoading()
		},
		methods: {
			not(){
				uni.showToast({
					icon:"none",
					title:"暂未开放"
				})
			},
			get_V(){
				var _this=this
				uni.request({
					url: this.$BASE_URL+'/index.php?i=2&c=entry&m=ewei_shopv2&do=mobile&r=acommsion.getappversion&app=1',
					method: 'POST',
					success: res => {
						_this.versionUrl = res.data.version
					
					},
					fail: () => {},
					complete: () => {},
				});
			},
			jumpdata() {
				uni.request({
					url: this.$BASE_URL + '/index.php?i=2&c=entry&m=ewei_shopv2&do=mobile&r=member&app=1',
					method: 'POST',
					data: {
						'openid': this.openid
					},
					header: {
						'Content-Type': 'application/x-www-form-urlencoded'
					},
					success: res => {
						console.log(res.data.mobile)

						if (!res.data.mobile) {
							uni.navigateTo({
								url: '../../member/bind/telephone'
							})
							return
						}
						if (res.data.status == 0) {
							uni.showToast({
								title: res.data.result.message,
								icon: "none"
							});
							setTimeout(() => {
								uni.navigateTo({
									url: '../../member/info/info'
								});
							}, 2000)
						}
					},
					fail: () => {},
					complete: () => {}
				});
			},
			jump(e) {
				uni.navigateTo({
					url: e.currentTarget.dataset.src
				});
			},
			logout() {
				uni.showModal({
					content: "是否退出登录",
					confirmText: "确定",
					cancelText: "取消",
					success: res => {
						if (res.confirm) {
							uni.clearStorageSync()
							console.log(1);
							uni.reLaunch({
								url: '/pages/login/login'
							});
						}
					}
				})
			},
			password() {
				uni.showModal({
					title: '提示',
					content: '功能暂未开放',
					showCancel: false,
					confirmColor: "#DD524D",
					success() {
						return
					}
				})
			},
			jumpsure() {
				uni.showModal({
					title: '',
					content: '清除成功',
					showCancel: false,
					confirmColor: "#DD524D",
					success() {
						return
					}
				})
			},
			checknew() {
				uni.showModal({
					title: '',
					content: '已经是最新的版本啦',
					showCancel: false,
					confirmColor: "#DD524D",
					success() {
						return
					}
				})
			}
		}
	}
</script>

<style lang="scss">
	page {
		background-color: #f2f5fa;
	}

	.container {
		width: 100%;
		height: 100vh;
		height: calc(100vh - 100rpx);
		background: url('/static/zn/hander_bg.png')0 0 no-repeat;
		// background-size: 150% 106%;

		background-size: 100%;
		box-sizing: border-box;
	}

	.content {
		padding: 30rpx;
	}

	.content_box {
		background-color: #FFFFFF;
		border-radius:0 0 20rpx 20rpx;
		box-shadow: 0px 2px 8px 3px rgba(235, 235, 235, 0.4);
		padding: 0 30rpx;

		.input_item {
			height: 90rpx;
			display: flex;
			align-items: center;
			justify-content: space-between;

			.titles {
				width: 200rpx;
				margin-right: 30rpx;
			}
		}

		.u-f-ac {
			border-bottom: 1px solid #f2f5fa;
		}
	}
</style>